/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rultax.neural.activation;

import com.rultax.neural.util.BoundNumbers;

/**
 * The sigmoid activation function takes on a sigmoidal shape. Only positive
 * numbers are generated. Do not use this activation function if a negative
 * number output is desired.
 * 
 * @author Scott
 */
public class ActivationSigmoid implements ActivationFunction{

    @Override
    public double activationFunction(double d) {
        return 1.0 / (1.0 + BoundNumbers.exp(-1.0 * d));
    }

    @Override
    public double derivativeFunction(double d) {
        return d * (1.0 - d);
    }
    
}
